package com.xhtt.modules.app.controller.inspection;

import com.xhtt.common.utils.Constant;
import com.xhtt.common.utils.R;
import com.xhtt.modules.app.annotation.Login;
import com.xhtt.modules.inspection.service.IInsTaskStepPointService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * <p>
 * 巡检管理-巡检综合查询-巡检任务查询
 * </p>
 *
 * @author xj
 * @since 2019-01-29
 */
@RestController
@RequestMapping("app/ins-task-step-point")
@Api(value = "巡检管理-巡检综合查询-巡检任务查询", tags = "巡检管理-巡检综合查询-巡检任务查询")
public class InsTaskStepPointController {


    @Autowired
    private IInsTaskStepPointService insTaskStepPointService;

    @GetMapping(value = "/detail")
    @ApiOperation("巡检管理-巡检综合查询-巡检任务查询-记录查询(web)")
    public R detail(@RequestParam Map<String, Object> params) {
        return R.ok().put(Constant.DATA, insTaskStepPointService.queryPageByStepId(params));
    }

    @GetMapping(value = "/export")
    @ApiOperation("巡检管理-综合查询-巡检任务查询-记录查询导出")
    @Login
    public void export(HttpServletResponse response, @RequestParam Map<String, Object> params) {
        insTaskStepPointService.exportExcel(response, params);
    }

}
